//
//  ResultView.m
//  兼职页面
//
//  Created by kuiyuan liang on 2021/5/23.
//

#import "ResultView.h"
#import "CommonUtil.h"
#import "ZooDataView.h"

@interface ResultView ()

@property (strong, nonatomic) NSArray * datas;
@property (strong, nonatomic) UILabel * totalTitleLabel;
@end

@implementation ResultView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
        
        
        CGFloat w = self.width/6;
        for (NSInteger i = 0; i < self.datas.count; i++) {
          
            ZooDataView *zoo = [[ZooDataView alloc] initWithFrame:CGRectMake(i * w, 0, w, self.height-AD(30))];
            [zoo refreshData:self.datas[i]];
            [self addSubview:zoo];
            
        }
        [self addSubview:self.totalTitleLabel];
        

        
        self.totalTitleLabel.bottom = self.height;
    }
    return self;
}






#pragma mark - lazy
-(NSArray *)datas{
    if (!_datas) {
        _datas = @[@"鼠",@"牛",@"虎",@"兔",@"龙",@"蛇"];
    }
    return _datas;
}
-(UILabel *)totalTitleLabel{
    if (!_totalTitleLabel) {
        _totalTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.width, AD(30))];
        _totalTitleLabel.textColor = [UIColor blackColor];
        _totalTitleLabel.font = [UIFont boldSystemFontOfSize:AD(16)];
        _totalTitleLabel.textAlignment = NSTextAlignmentCenter;
        _totalTitleLabel.text = @"第034期特肖（共1人）";
    }
    return _totalTitleLabel;
}

@end
